home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-06 / fileow.zip / FILEOWN.DOC < prev    next >
Text File  |  1991-03-07  |  4KB  |  75 lines

  1. FILEOWN.DOC
  2.  
  3. Company:        Illinois Department of Revenue
  4. Author:         John Adkins
  5. Date:           March 7, 1991
  6.  
  7. NETWORK PROBLEM
  8.  
  9. At the Illinois Department of Revenue, a Novell Netware 386 v3.1 network
  10. was receiving "disk full" errors when appending information to files.
  11. The disk and users actually had over 150MB of available space.  As I was
  12. informed by Don Crawford [76702,256], a SysOp for the NetWire forum on
  13. CompuServe, Netware will only allow a file to expand to the last 4096
  14. byte block if the owner of the file no longer exists.  We had deleted no
  15. users recently, but we had converted from NW286 to NW386 not more than a
  16. few weeks ago.
  17.  
  18. Upon further examination of the files causing the error message, I was
  19. able to determine that these files had no owner listed.  By using the
  20. Novell NDIR command, these files display the owner as N/A.  The Novell
  21. FILER command shows "no owner" for the files in question.  To fix the
  22. problem, I needed to provide the file with a valid owner id.  Rather
  23. than using the FILER utility to fill all files with some value, I
  24. decided to write a program to "claim ownership" of any file which was
  25. not currently owned.  This would not affect files that already had
  26. owners listed where the FILER would blindly replace existing owner ids
  27. with my own.
  28.  
  29. THE SOLUTION
  30.  
  31. Armed with Turbo C++ v1.0 and the Novell C API libraries, I proceeded to
  32. write FILEOWN.  This program will read the current directory, and determine
  33. if each file has an owner.  If the file has an owner, the file is
  34. skipped.  Otherwise, the userid of the person running the program is set
  35. as the file's owner.  As a saftey feature, passing any parameter to
  36. FILEOWN instructs the program to only display information and the
  37. program will not perform any updates to the file information.
  38.  
  39. NOTE TO NOVELL API PROGRAMMERS:
  40.  
  41. While writing this program, I think I discovered a bug (or at least
  42. strange behavior) in the Novell API.  Originally, I used the Novell
  43. ScanFileInformation routine to read the server's directory.  This
  44. routine does not appear to behave normally if files exist which have no
  45. owner.  By using the Novell routines on a directory containing over 800
  46. files, my program only finds about 120 files!  I modified the program to
  47. use Turbo C's runtime library functions findfirst and findnext routines
  48. for reading directories.  The new version of the program correctly read
  49. the entire directory.  I'm not sure if this is an intended feature or a
  50. bug in the Novell C API, but at least I found a workable solution.
  51.  
  52. LICENSING
  53.  
  54. This program is hereby donated to the PUBLIC DOMAIN.  You may use this
  55. program in any "legal" and "moral" way that benefits society.  Any use
  56. of the source code must first involve the removal of any mention of the
  57. Illinois Department of Revenue and John Adkins.  In addition, if the
  58. source code is modified and recompiled, the new program MUST NOT be
  59. called FILEOWN.
  60.  
  61. DISTRIBUTION
  62.  
  63. The files FILEOWN.C, FILEOWN.EXE, and FILEOWN.DOC may be freely
  64. distributed as long as these files are distributed as a group.  Any
  65. modifications to the source, documentation or executable files must be
  66. FULLY and ACCURATELY documented in the file FILEOWN.DOC.
  67.  
  68. DISCLAIMER
  69.  
  70. The author of FILEOWN and the Illinois Department of Revenue make no
  71. claims as to the suitability of this program for any purpose.  The
  72. author and the Illinois Department of Revenue assume no liability or
  73. responsibility for the use or misuse of these files.
  74.  
  75.